package com.hnhn.c69.boot.cofig;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration  //声明一个类为配置类，用于取代bean.xml配置文件注册bean对象。
public class WebConfig implements WebMvcConfigurer {

    @Override  //表示子类重写了父类的方法
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("toAdd").setViewName("add");
    }
}
